package com.explainus.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class DBaseHalper extends  SQLiteOpenHelper
{

	private static final int DB_VERSION = 1;
	public static final String TABLE_NAME = "words";
	public static final String WORD = "word";
	private static final String CREATE_TABLE = "create table " + TABLE_NAME + " ( _id integer primary key autoincrement, "
	       + WORD + " TEXT)";
	private static final String DROP_TABLE = "drop table "+TABLE_NAME;
	
	
	public DBaseHalper(Context context, String dbName) 
	{
		super(context, dbName, null, DB_VERSION);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void onCreate(SQLiteDatabase sqLiteDatabase) 
	{
		sqLiteDatabase.execSQL(DROP_TABLE);
		sqLiteDatabase.execSQL(CREATE_TABLE);
	}

	@Override
	public void onUpgrade(SQLiteDatabase base, int arg1, int arg2) 
	{
		base.execSQL(DROP_TABLE);
		base.execSQL(CREATE_TABLE);
		
	}

	
}
